#include <iostream>

using namespace std;

int main()
{
	int count = 1, count2 = 2;
	int sum = 0;

	for (; count < 4000000 && count2 < 4000000;)
	{
		if (count % 2 == 0)
			sum += count;

		if (count2 % 2 == 0)
			sum += count2;

		count += count2;
		count2 += count;
	}

	cout << sum << endl;
}